home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / fsp-2.7 / fsp-2 / fsp / clients / fmkdir.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-24  |  1.2 KB  |  46 lines

  1.     /*********************************************************************\
  2.     *  Copyright (c) 1991 by Wen-King Su (wen-king@vlsi.cs.caltech.edu)   *
  3.     *                                                                     *
  4.     *  You may copy or modify this file in any manner you wish, provided  *
  5.     *  that this notice is always included, and that you hold the author  *
  6.     *  harmless for any loss or damage resulting from the installation or *
  7.     *  use of this software.                                              *
  8.     \*********************************************************************/
  9.  
  10. #include "tweak.h"
  11. #include "client_def.h"
  12. #include "c_extern.h"
  13.  
  14. static int make_dir PROTO1(char *, p)
  15. {
  16.   char *op;
  17.   UBUF *ub;
  18.   
  19.   op = util_abs_path(p);
  20.   
  21.   ub = client_interact(CC_MAKE_DIR,0L, strlen(op), (unsigned char *)op+1, 0,
  22.                (unsigned char *)NULLP);
  23.   
  24.   if(ub->cmd == CC_ERR) {
  25.     fprintf(stderr,"Can't create %s: %s\n",p,ub->buf);
  26.     free(op);
  27.     return(-1);
  28.   }
  29.   
  30.   printf("%s\t: %s\n",p,ub->buf);
  31.   
  32.   free(op);
  33.   return(0);
  34. }
  35.  
  36. int main PROTO3(int, argc, char **, argv, char **, envp)
  37. {
  38.   char **av, *av2[2];
  39.   
  40.   env_client();
  41.   while(*++argv) make_dir(*argv);
  42.   client_done();
  43.   
  44.   exit(0);
  45. }
  46.